<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="html/html; charset=utf-8" />
		<title>TCBlobDownloaderDelegate Protocol Reference</title>
		<meta id="xcode-display" name="xcode-display" content="render"/>
		<link rel="stylesheet" type="text/css" href="../css/styles.css" media="all" />
		<link rel="stylesheet" type="text/css" media="print" href="../css/stylesPrint.css" />
		<meta name="generator" content="appledoc 2.2 (build 961)" />
	</head>
	<body>
		<header id="top_header">
			<div id="library" class="hideInXcode">
				<h1><a id="libraryTitle" href="../index.html">TCBlobDownload </a></h1>
				<a id="developerHome" href="../index.html">thibaultCha</a>
			</div>
			
			<div id="title" role="banner">
				<h1 class="hideInXcode">TCBlobDownloaderDelegate Protocol Reference</h1>
			</div>
			<ul id="headerButtons" role="toolbar">
				<li id="toc_button">
					<button aria-label="Show Table of Contents" role="checkbox" class="open" id="table_of_contents"><span class="disclosure"></span>Table of Contents</button>
				</li>
				<li id="jumpto_button" role="navigation">
					<select id="jumpTo">
	<option value="top">Jump To&#133;</option>
	
	<option value="overview">Overview</option>
	
	
	
	
	<option value="tasks">Tasks</option>
	
	
	
	
	
	
	
	
	
	<option value="instance_methods">Instance Methods</option>
	
	<option value="//api/name/download:didFinishWithSucces:atPath:">&nbsp;&nbsp;&nbsp;&nbsp;- download:didFinishWithSucces:atPath:</option>
	
	<option value="//api/name/download:didReceiveData:onTotal:">&nbsp;&nbsp;&nbsp;&nbsp;- download:didReceiveData:onTotal:</option>
	
	<option value="//api/name/download:didReceiveFirstResponse:">&nbsp;&nbsp;&nbsp;&nbsp;- download:didReceiveFirstResponse:</option>
	
	<option value="//api/name/download:didStopWithError:">&nbsp;&nbsp;&nbsp;&nbsp;- download:didStopWithError:</option>
	
	
	
</select>
				</li>
			</ul>
		</header>
		<nav id="tocContainer" class="isShowingTOC">
			<ul id="toc" role="tree">
				
<li role="treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#overview">Overview</a></span></li>




<li role="treeitem" id="task_treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#tasks">Tasks</a></span><ul>
	
</ul></li>









<li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#instance_methods">Instance Methods</a></span><ul>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/download:didFinishWithSucces:atPath:">download:didFinishWithSucces:atPath:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/download:didReceiveData:onTotal:">download:didReceiveData:onTotal:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/download:didReceiveFirstResponse:">download:didReceiveFirstResponse:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/download:didStopWithError:">download:didStopWithError:</a></span></li>
	
</ul></li>


			</ul>
		</nav>
		<article>
			<div id="contents" class="isShowingTOC" role="main">
				<a title="TCBlobDownloaderDelegate Protocol Reference" name="top"></a>
				<div class="main-navigation navigation-top">
					<ul>
	<li><a href="../index.html">Index</a></li>
	<li><a href="../hierarchy.html">Hierarchy</a></li>
</ul>
				</div>
				<div id="header">
					<div class="section-header">
						<h1 class="title title-header">TCBlobDownloaderDelegate Protocol Reference</h1>
					</div>		
				</div>
				<div id="container">	
					
					<div class="section section-specification"><table cellspacing="0"><tbody>
						<tr>
	<td class="specification-title">Conforms to</td>
	<td class="specification-value">NSObject</td>
</tr><tr>
	<td class="specification-title">Declared in</td>
	<td class="specification-value">TCBlobDownloader.h</td>
</tr>
						</tbody></table></div>
					
                    
                    
					
					<div class="section section-overview">
						<a title="Overview" name="overview"></a>
						<h2 class="subtitle subtitle-overview">Overview</h2>
						<p>The <code>TCBlobDownloaderDelegate</code> protocol defines the methods supported by <a href="../Classes/TCBlobDownloader.html"><code>TCBlobDownloader</code></a> to notify you of the state of the download.</p>
					</div>
					
					
					
					
					
					<div class="section section-tasks">
						<a title="Tasks" name="tasks"></a>
						<h2 class="subtitle subtitle-tasks">Tasks</h2>
						
						
						
						

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/download:didReceiveFirstResponse:">&ndash;&nbsp;download:didReceiveFirstResponse:</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/download:didReceiveData:onTotal:">&ndash;&nbsp;download:didReceiveData:onTotal:</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/download:didStopWithError:">&ndash;&nbsp;download:didStopWithError:</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/download:didFinishWithSucces:atPath:">&ndash;&nbsp;download:didFinishWithSucces:atPath:</a></code>
	</span>
	
	
</li>
						</ul>
						
					</div>
					
					
					
					
					
					
					
					
					
					<div class="section section-methods">
						<a title="Instance Methods" name="instance_methods"></a>
						<h2 class="subtitle subtitle-methods">Instance Methods</h2>
						
						<div class="section-method">
	<a name="//api/name/download:didFinishWithSucces:atPath:" title="download:didFinishWithSucces:atPath:"></a>
	<h3 class="subsubtitle method-title">download:didFinishWithSucces:atPath:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Optional. Called when the download is finished or when the operation has been cancelled. The <a href="../Classes/TCBlobDownloader.html"><code>TCBlobDownloader</code></a> operation will be removed from <a href="../Classes/TCBlobDownloadManager.html"><code>TCBlobDownloadManager</code></a> just after this method is called.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)download:(TCBlobDownloader *)<em>blobDownload</em> didFinishWithSucces:(BOOL)<em>downloadFinished</em> atPath:(NSString *)<em>pathToFile</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>blobDownload</em></dt>
			<dd><p>The <a href="../Classes/TCBlobDownloader.html"><code>TCBlobDownloader</code></a> object whose execution is finished.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>downloadFinished</em></dt>
			<dd><p><code>YES</code> if the file has been downloaded, <code>NO</code> if not.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>pathToFile</em></dt>
			<dd><p>The path where the file has been downloaded.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	<div class="method-subsection availability">
		<h4 class="method-subtitle parameter-title">Availability</h4>
		<p>1.3</p>
	</div>
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">TCBlobDownloader.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/download:didReceiveData:onTotal:" title="download:didReceiveData:onTotal:"></a>
	<h3 class="subsubtitle method-title">download:didReceiveData:onTotal:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Optional. Called on each response from the server while the download is occurring.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)download:(TCBlobDownloader *)<em>blobDownload</em> didReceiveData:(uint64_t)<em>receivedLength</em> onTotal:(uint64_t)<em>totalLength</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>blobDownload</em></dt>
			<dd><p>The <a href="../Classes/TCBlobDownloader.html"><code>TCBlobDownloader</code></a> object which received data.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>receivedLength</em></dt>
			<dd><p>The total number of already received bytes.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>totalLength</em></dt>
			<dd><p>The total number of bytes of the file.</p>

<h2>Note</h2>

<p>If you pause and restart later a download, the new <a href="../Classes/TCBlobDownloader.html"><code>TCBlobDownloader</code></a> will resume it from where it has stopped (see <code>fileName</code> property for more explanations). Therefore, you might want to track yourself the total size of the file when you first tried to download it, otherwise the <code>totalLength</code> is the actual remaining length to download and might not suit your needs if you do something such as a progress bar.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	<div class="method-subsection availability">
		<h4 class="method-subtitle parameter-title">Availability</h4>
		<p>1.0</p>
	</div>
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">TCBlobDownloader.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/download:didReceiveFirstResponse:" title="download:didReceiveFirstResponse:"></a>
	<h3 class="subsubtitle method-title">download:didReceiveFirstResponse:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Optional. Called when the <a href="../Classes/TCBlobDownloader.html"><code>TCBlobDownloader</code></a> object has received the first response from the server.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)download:(TCBlobDownloader *)<em>blobDownload</em> didReceiveFirstResponse:(NSURLResponse *)<em>response</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>blobDownload</em></dt>
			<dd><p>The <a href="../Classes/TCBlobDownloader.html"><code>TCBlobDownloader</code></a> object receiving the first response.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>response</em></dt>
			<dd><p>The <code>NSURLResponse</code> from the server.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	<div class="method-subsection availability">
		<h4 class="method-subtitle parameter-title">Availability</h4>
		<p>1.0</p>
	</div>
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">TCBlobDownloader.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/download:didStopWithError:" title="download:didStopWithError:"></a>
	<h3 class="subsubtitle method-title">download:didStopWithError:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Optional. Called when an error occur during the download. If this method is called, the <a href="../Classes/TCBlobDownloader.html"><code>TCBlobDownloader</code></a> will be automatically cancelled just after, without deleting the the already downloaded parts of the file. This is done by calling <code>cancelDownloadAndRemoveFile:</code></p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)download:(TCBlobDownloader *)<em>blobDownload</em> didStopWithError:(NSError *)<em>error</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>blobDownload</em></dt>
			<dd><p>The <a href="../Classes/TCBlobDownloader.html"><code>TCBlobDownloader</code></a> object which trigerred an error.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>error</em></dt>
			<dd><p>The trigerred error.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	<div class="method-subsection availability">
		<h4 class="method-subtitle parameter-title">Availability</h4>
		<p>1.0</p>
	</div>
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">TCBlobDownloader.h</code><br />
	</div>				
	
	
</div>
						
					</div>
					
					
                    
                    
				</div>
				<div class="main-navigation navigation-bottom">
					<ul>
	<li><a href="../index.html">Index</a></li>
	<li><a href="../hierarchy.html">Hierarchy</a></li>
</ul>
				</div>
				<div id="footer">
					<hr />
					<div class="footer-copyright">
						<p><span class="copyright">&copy; 2014 thibaultCha. All rights reserved. (Last updated: 2014-03-08)</span><br />
						
						<span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 961)</a>.</span></p>
						
					</div>
				</div>
			</div>
		</article>
		<script type="text/javascript">
			function jumpToChange()
			{
				window.location.hash = this.options[this.selectedIndex].value;
			}
			
			function toggleTOC()
			{
				var contents = document.getElementById('contents');
				var tocContainer = document.getElementById('tocContainer');
				
				if (this.getAttribute('class') == 'open')
				{
					this.setAttribute('class', '');
					contents.setAttribute('class', '');
					tocContainer.setAttribute('class', '');
					
					window.name = "hideTOC";
				}
				else
				{
					this.setAttribute('class', 'open');
					contents.setAttribute('class', 'isShowingTOC');
					tocContainer.setAttribute('class', 'isShowingTOC');
					
					window.name = "";
				}
				return false;
			}
			
			function toggleTOCEntryChildren(e)
			{
				e.stopPropagation();
				var currentClass = this.getAttribute('class');
				if (currentClass == 'children') {
					this.setAttribute('class', 'children open');
				}
				else if (currentClass == 'children open') {
					this.setAttribute('class', 'children');
				}
				return false;
			}
			
			function tocEntryClick(e)
			{
				e.stopPropagation();
				return true;
			}
			
			function init()
			{
				var selectElement = document.getElementById('jumpTo');
				selectElement.addEventListener('change', jumpToChange, false);
				
				var tocButton = document.getElementById('table_of_contents');
				tocButton.addEventListener('click', toggleTOC, false);
				
				var taskTreeItem = document.getElementById('task_treeitem');
				if (taskTreeItem.getElementsByTagName('li').length > 0)
				{
					taskTreeItem.setAttribute('class', 'children');
					taskTreeItem.firstChild.setAttribute('class', 'disclosure');
				}
				
				var tocList = document.getElementById('toc');
				
				var tocEntries = tocList.getElementsByTagName('li');
				for (var i = 0; i < tocEntries.length; i++) {
					tocEntries[i].addEventListener('click', toggleTOCEntryChildren, false);
				}
				
				var tocLinks = tocList.getElementsByTagName('a');
				for (var i = 0; i < tocLinks.length; i++) {
					tocLinks[i].addEventListener('click', tocEntryClick, false);
				}
				
				if (window.name == "hideTOC") {
					toggleTOC.call(tocButton);
				}
			}
			
			window.onload = init;
			
			// If showing in Xcode, hide the TOC and Header
			if (navigator.userAgent.match(/xcode/i)) {
				document.getElementById("contents").className = "hideInXcode"
				document.getElementById("tocContainer").className = "hideInXcode"
				document.getElementById("top_header").className = "hideInXcode"
			}
			
		</script>
	</body>
</html>